import request from '@/utils/request'

//列表
export function taskList(data: any) {
  return request({
    url: '/scrm-api/console/work/task/list',
    method: 'post',
    data
  })
}

//审核设置-保存
export function auditSet(data: any) {
  return request({
    url: '/scrm-api/console/work/task/audit-set',
    method: 'post',
    data
  })
}

//审核设置-查看
export function auditView() {
  return request({
    url: '/scrm-api/console/work/task/audit-view',
    method: 'get'
  })
}

//统计-基础信息
export function statInfo(data: any) {
  return request({
    url: '/scrm-api/console/work/task/stat-info',
    method: 'get',
    params: data
  })
}
//统计-进度接口
export function statProcess(data: any) {
  return request({
    url: '/scrm-api/console/work/task/stat-progress',
    method: 'post',
    data
  })
}
//统计-筛选
export function statList(data: any) {
  return request({
    url: '/scrm-api/console/work/task/stat-list',
    method: 'post',
    data
  })
}

//执行明细-列表
export function execDetail(data: any) {
  return request({
    url: '/scrm-api/console/work/task/exec-detail',
    method: 'post',
    data
  })
}

//执行明细-提醒
export function taskRemind(data: any) {
  return request({
    url: '/scrm-api/console/work/task/remind',
    method: 'post',
    data
  })
}

//执行周期-返回周期
export function execCyle(data: any) {
  return request({
    url: '/scrm-api/console/work/task/exec-cycle',
    method: 'get',
    params: data
  })
}

//执行明细-执行员工详情
export function workUserDetail(data: any) {
  return request({
    url: '/scrm-api/console/work/task/work-user-detail',
    method: 'post',
    data
  })
}

//执行明细-客户执行详情
export function objectDetail(data: any) {
  return request({
    url: '/scrm-api/console/work/task/object-detail',
    method: 'get',
    params: data
  })
}

//执行明细-审核
export function taskAudit(data: any) {
  return request({
    url: '/scrm-api/console/work/task/audit',
    method: 'post',
    data
  })
}

//删除跟进
export function fllowDel(data: any) {
  return request({
    url: '/scrm-api/console/customer/follow/del',
    method: 'post',
    data
  })
}

//获取跟进详情
export function followDetail(data: any) {
  return request({
    url: '/scrm-api/console/customer/follow/detail-second',
    method: 'get',
    params: data
  })
}

//跟新跟进
export function updateFollow(data: any) {
  return request({
    url: '/scrm-api/console/customer/follow/update',
    method: 'post',
    data: data
  })
}
// 导入文件
export function importTemplate(data: any) {
  return request({
    url: '/scrm-api/console/work/task/import-object',
    method: 'POST',
    // type: 2,
    data
  })
}

//线索转化-列表
export function taskTran(data: any) {
  return request({
    url: '/scrm-api/console/work/task/tran',
    method: 'GET',
    params: data
  })
}

//编辑任务 （电话销售+客户拜访+加微任务）
export function taskUpdate(data: any) {
  return request({
    url: '/scrm-api/console/work/task/update',
    method: 'post',
    data: data
  })
}

//z新建任务 （电话销售+客户拜访+加微任务
export function createTask(data: any) {
  return request({
    url: '/scrm-api/console/work/task/save',
    method: 'post',
    data: data
  })
}

//查看任务详情  （电话销售+客户拜访+加微任务
export function taskDetail(data: any) {
  return request({
    url: '/scrm-api/console/work/task/detail',
    method: 'get',
    params: data
  })
}

//客户中心-获取跟进详情
export function getFollow(data: any) {
  return request({
    url: '/scrm-api/console/customer/follow/detail',
    method: 'get',
    params: data
  })
}
// 线索转化-查询-下拉框线索等级
// ---------------------------------------------------------------------------------优化---------------------------------------------------------------------------------

export function getClueLevelList(params?: any) {
  return request({
    url: '/scrm-api/console/clue/level/list',
    params
  })
}
// 线索转化列表
export function getClueConvList(data?: any) {
  return request({
    method: 'POST',
    url: '/scrm-api/console/work/task/clue-conv-list',
    data
  })
}
// 线索转化列表-放弃/批量放弃
export function taskClueAbandon(data: any) {
  return request({
    url: '/scrm-api/console/work/task/clue-abandon',
    method: 'POST',
    data
  })
}
// 客户转化-请求转换参数
export function taskConversionPer(data: any) {
  return request({
    url: '/scrm-api/console/work/task/conversion-pre',
    method: 'POST',
    data
  })
}
// 客户转化-批量请求转换参数
export function batchTaskConversionPer(data: any) {
  return request({
    url: '/scrm-api/console/work/task/batch-conversion',
    method: 'POST',
    data
  })
}
// 客户转化操作
export function taskConversion(data: any) {
  return request({
    url: '/scrm-api/console/work/task/conversion',
    method: 'POST',
    data
  })
}
// 添加线索跟进
export function addClue(data: any) {
  return request({
    method: 'POST',
    url: '/scrm-api/console/clue/follow/create',
    data
  })
}
// 编辑线索跟进
export function viewClue(data: any) {
  return request({
    method: 'POST',
    url: '/scrm-api/console/clue/follow/view',
    params: data
  })
}
export function editClue(data: any) {
  return request({
    method: 'POST',
    url: '/scrm-api/console/clue/follow/edit',
    data
  })
}
// 删除跟进
export function delClue(data: any) {
  return request({
    method: 'POST',
    url: '/scrm-api/console/clue/follow/del',
    data
  })
}
// 企业线索 转化为 企业客户
export const cpCnpre = (data: any) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/clue/company-conversion-pre',
    data
  })
}
// 企业线索 转化为 企业客户 保存
export const saveCn = (data: any) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/clue/company-conversion',
    data
  })
}
